.tutorial-pane {
  display: flex;
  flex-direction: row;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;

  font-size: 18px;

  .ToC-scrollable {
    flex-grow: 0;
    flex-shrink: 0;
    width: 12em;

    .ToC-container {
      height: 100%;
      overflow-y: auto;
      margin: 0px;
      padding: 0px;

      .ToC {
        list-style: none;
        padding: 0px;
        li {
          padding: 8px;
          margin: 1rem;
          background-color: #eee;
          border-radius: 4px;
          &:hover {
            cursor: pointer;
            background-color: #ddd;
          }
        }
        li.active,
        li.active:hover {
          font-weight: bold;
          background-color: #dfd;
          border-radius: 4px;
          cursor: default;
        }
      }
    }
  }

  .TutorialChapter-scrollable {
    flex-grow: 1;

    .TutorialChapter-container {
      height: 100%;
      overflow-y: auto;
      margin: 0px;
      padding: 0px;

      .TutorialChapter {
        margin: 2rem 2rem 8rem 2rem;

        h3 {
          font-size: 1.625rem;
        }

        code {
          margin: 0px 2px;
          color: #a00;
        }

        /* Zeroth-order approximation to italic correction: */
        em {
          padding-right: 0.1rem;
        }

        > div > pre {
          background-color: #eee;
          padding: 1rem;
          margin: 0px 2rem 0.875rem;
          code {
            color: black;
          }
        }

        .scratchblocks {
          margin: 0.5rem auto;
          text-align: center;
        }

        p.img-float-right {
          float: right;
          margin: 0.5rem 0px 0.5rem 1rem;
        }

        p.img-float-left {
          float: left;
          margin: 0.5rem 1rem 0.5rem 0px;
        }

        p.img-center {
          text-align: center;
        }

        blockquote {
          margin: 0rem 6rem;
        }

        .asset-credits {
          .credit-intro {
            margin-bottom: 0.25rem;
          }
          .asset-filename {
            color: #a00;
          }
          .credits {
            margin: 0rem 3rem;
          }
        }
      }
    }
  }
}

.TutorialChapter:focus {
  outline: none;
}

div.patch-container {
  clear: both;
  margin: 0px 1rem 1rem 1rem;
  margin-left: 1em;
  background-color: #f7f7f7;
  border-spacing: 0px;
  padding: 0.5rem 1rem;

  .header {
    display: flex;
    flex-direction: row;
    align-items: center;
    h1.decoration {
      padding: 1.5ex 1em;
      margin: 0px;
      background-color: #f7f7f7;
      text-align: left;
      font-weight: bold;
      font-size: 100%;
      color: #000;
    }
    button {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      padding: 2px;
      width: 2rem;
      height: 2rem;
    }
  }

  .patch-hunk-spacer {
    margin: 1.25rem 0rem;
    text-align: center;
  }

  table {
    padding-bottom: 2.5ex;

    tr,
    tr td {
      padding: 0px;
      margin: 0px;
      border: none;
    }

    td.linenum {
      width: 3em;
      padding-left: 1em;
      padding-right: 1em;
      text-align: right;
      color: #666;
    }

    pre {
      line-height: 120%;
      padding: 4px 0px 2px;
      margin: 0px;
      border: none;
      border-radius: 0px;
      background-color: inherit;

      span.visible-leading-spaces {
        color: #aaa;
      }
    }

    td {
      position: relative;
      div.copy-button {
        z-index: 1;
        user-select: none;
        position: absolute;
        top: 0px;
        right: 0px;
        p {
          position: absolute;
          top: 0px;
          right: 0px;
          margin: 4px 4px 0px 0px;
          padding: 4px;
          background-color: #293;
          color: white;
          border-radius: 4px;
        }
        p.content {
          cursor: pointer;

          &:hover {
            background-color: #172;
          }
        }
        p.content.active {
          animation: fade-back-in-keyframes 1.5s;
        }
        p.feedback {
          padding-left: 0.75rem;
          padding-right: 0.75rem;
          display: none;
        }
        p.feedback.active {
          display: block;
          animation: fade-out-keyframes 1s;
        }
        @keyframes fade-back-in-keyframes {
          0% {
            opacity: 0;
          }
          67% {
            opacity: 0;
          }
          100% {
            opacity: 1;
          }
        }
        @keyframes fade-out-keyframes {
          0% {
            opacity: 1;
          }
          75% {
            opacity: 1;
          }
          100% {
            opacity: 0;
          }
        }
      }
    }

    td:nth-child(3) {
      width: 100%;
      padding-left: 2px;
      border-left: solid 1px #aaa;
    }

    tbody tr td span.add-or-del {
      font-size: 112.5%;
      padding: 0px 6px;
      border-radius: 6px;
      margin-right: -3px;
      color: black;
    }

    tbody.diff-del tr {
      td:nth-child(2) span,
      td:nth-child(3) {
        pre {
          color: black;
        }
      }
      td:nth-child(2) span {
        background-color: #ffaaaa;
      }
      td:nth-child(3) {
        background-color: #ffcaca;
      }
    }

    tbody.diff-add tr {
      td:nth-child(1) span,
      td:nth-child(3) {
        pre {
          color: black;
        }
      }
      td:nth-child(1) span {
        background-color: #8aef8a;
      }
      td:nth-child(3) {
        background-color: #caffca;
      }
    }

    tbody.diff-unch tr td pre {
      color: #666;
    }
  }

  p.tutorial-compiler-warning {
    background-color: #f88;
    color: black;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 4px solid #a00;
    border-radius: 4px;
    margin-bottom: 0px;
  }
}

.navigation-buttons {
  margin: 2rem 3rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
}

.navigation-button {
  cursor: pointer;
  user-select: none;
  line-height: 133%;
  padding: 1ex;
  border-radius: 4px;
  width: 12em;
}

.navigation-run-project {
  background-color: #007bff;
  border: 1px solid #0069d9;
  color: white;
  line-height: 100%;
  width: auto;

  &:hover {
    background-color: #0069d9;
    border: 1px solid #05b;
  }
}

.navigation-next {
  background-color: #6d7;
  border: 1px solid #3a4;

  &:hover {
    background-color: #5c6;
    border: 1px solid #293;
  }
}

.navigation-prev {
  background-color: #bbb;
  border: 1px solid #888;

  &:hover {
    background-color: #aaa;
    border: 1px solid #777;
  }
}

// For the first or last chapter, still justify up the buttons left or
// right as appropriate.

.navigation-next:only-child {
  margin-left: auto;
}

.navigation-prev:only-child {
  margin-right: auto;
}
